package com.google.code.twithis.core.processor;

import java.util.Hashtable;

import com.google.code.twithis.core.processor.impl.EventProcessor;
import com.google.code.twithis.core.processor.impl.MemoProcessor;
import com.google.code.twithis.core.processor.impl.ToDoProcessor;

public abstract class ProcessorFactory {

	private static Hashtable names = new Hashtable();

	static {
		names.put("net.rim.blackberry.api.pdap.ToDoImpl", new ToDoProcessor());
		names.put("net.rim.blackberry.api.pdap.MemoImpl", new MemoProcessor());
		names.put("net.rim.blackberry.api.pdap.EventImpl", new EventProcessor());
	}

	public static String process(Object context) {
		String name = context.getClass().getName();

		Processor p = (Processor) names.get(name);

		if (p != null) {
			return p.getMessage(context);
		}

		return null;
	}

}
